Update LP/QP/MILP docs to cover 26.06 API additions#1339
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughExpanded cuOpt docs: added C problem write API and MPS file format constant; documented many solver parameter and method constants; added warm‑start/MIP‑start and MIP callback docs; extended lp-qp-milp settings; exposed Python Problem members and added SOCP (beta) docs. ChangesAPI Documentation Expansion
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
docs/cuopt/source/lp-qp-milp-settings.rst (1)
570-576: 💤 Low valueClarify the default value notation for strong branching simplex iteration limit.
The note says "By default there is no iteration limit" but does not explicitly mention that the implementation uses
-1to represent "no limit." For consistency with other parameters (e.g.,CUOPT_RANDOM_SEEDat line 660), consider stating the actual default value.♻️ Suggested clarification
-.. note:: By default there is no iteration limit for strong branching solves. +.. note:: The default value is ``-1`` (no iteration limit).🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/cuopt/source/lp-qp-milp-settings.rst` around lines 570 - 576, Update the documentation for CUOPT_MIP_STRONG_BRANCHING_SIMPLEX_ITERATION_LIMIT to explicitly state that the implementation uses -1 to denote "no limit" (e.g., "Default: -1 (no limit)"), mirroring the notation used for other parameters like CUOPT_RANDOM_SEED; edit the paragraph and the note text so readers see the concrete default value and its meaning.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/cuopt/source/cuopt-c/lp-qp-milp/lp-qp-milp-c-api.rst`:
- Around line 46-49: Update the brief description so it accurately reflects
cuOptWriteProblem's purpose: change the sentence "Optimization problems can be
created or loaded via the following functions" to a phrase that includes writing
(for example, "Optimization problems can be created, loaded, or written via the
following functions") or split into two sentences separating creation/loading
from read/write operations; ensure both cuOptReadProblem and cuOptWriteProblem
are mentioned appropriately (e.g., "...loaded via cuOptReadProblem" and
"...written via cuOptWriteProblem") so the docstring precisely matches each
function's role.
In `@docs/cuopt/source/lp-qp-milp-settings.rst`:
- Around line 629-636: The docs for CUOPT_MIP_OBJECTIVE_STEP are incorrect: the
implementation treats objective_step as a 0/1 toggle (objective_step = 1 by
default) rather than a positive numeric step; update the text to state that
CUOPT_MIP_OBJECTIVE_STEP is a boolean-like flag (0 = disable, 1 = enable),
change the default in the note to 1 (enabled), and remove or reword any mention
of providing a positive step size to override detection so the wording matches
the implementation referenced in solver_settings.cu and solver_settings.hpp and
the objective_step field.
---
Nitpick comments:
In `@docs/cuopt/source/lp-qp-milp-settings.rst`:
- Around line 570-576: Update the documentation for
CUOPT_MIP_STRONG_BRANCHING_SIMPLEX_ITERATION_LIMIT to explicitly state that the
implementation uses -1 to denote "no limit" (e.g., "Default: -1 (no limit)"),
mirroring the notation used for other parameters like CUOPT_RANDOM_SEED; edit
the paragraph and the note text so readers see the concrete default value and
its meaning.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 4afe87cf-5eb8-4fda-8c04-6f8f5a8aec6c
📒 Files selected for processing (3)
docs/cuopt/source/cuopt-c/lp-qp-milp/lp-qp-milp-c-api.rstdocs/cuopt/source/cuopt-python/lp-qp-milp/lp-qp-milp-api.rstdocs/cuopt/source/lp-qp-milp-settings.rst
- C API: add cuOptWriteProblem, warm start functions (cuOptSetInitialPrimalSolution, cuOptSetInitialDualSolution, cuOptAddMIPStart), MIP callback types and registration functions, file format constants, MIP determinism mode constants, barrier iterative refinement constants, CUOPT_TERMINATION_STATUS_WORK_LIMIT, CUOPT_METHOD_UNSET, and all previously missing parameter constants (work limit, random seed, presolve file, num GPUs, MIP symmetry, MIP determinism mode, cut types, branching settings, etc.) - Python API: expose NumVariables, NumConstraints, NumNZs, IsMIP properties - Settings: add descriptions for work limit, random seed, presolve file, primal/dual infeasibility tolerances, barrier iterative refinement, barrier step scale, MIP determinism mode, MIP symmetry, flow cover/implied bound/clique cuts, objective step, semi-continuous big-M, batch PDLP reliability branching, strong branching simplex limit Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- lp-qp-features.rst: add Second-Order Cone Programming beta section explaining SOCP support via quadratic constraints, auto barrier selection, constraints/limitations, and Python/C usage examples - lp-qp-milp-c-api.rst: add beta note to cuOptAddQuadraticConstraint section explaining SOCP auto-detection and sense restrictions - lp-qp-milp-api.rst: expose QuadraticExpression __le__, __ge__, __neg__ operators via special-members for SOCP constraint authoring - Update index titles in C and Python sections to include SOCP Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
/ok to test e99f396 |
rgsl888prabhu
left a comment
There was a problem hiding this comment.
I would suggest to add few examples on SOCP to different APIs.
Restructure the combined LP/QP/MILP documentation into two distinct sections: - Continuous Optimization (LP, QP, SOCP/QCQP) with dedicated settings, C API, Python API, and examples pages - MIP with its own settings, C API, Python API, and examples pages Files are kept flat within existing lp-qp-milp/ directories. Old combined files remain on disk for reference but are removed from toctrees. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Fix RST title underline length warning in cuopt-python/lp-qp-milp/index.rst. Remove old combined LP/QP/MILP files that have been replaced by the split continuous/MIP documentation: - lp-qp-milp-settings.rst → continuous-settings.rst + mip-settings.rst - lp-qp-features.rst → continuous-features.rst - lp-qp-milp-c-api.rst → continuous-c-api.rst + mip-c-api.rst - lp-qp-example.rst → continuous-examples.rst - milp-examples.rst → mip-examples.rst - lp-qp-milp-api.rst → continuous-api.rst - lp-qp-milp-examples.rst → continuous-examples.rst + mip-examples.rst Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Split lp-qp-milp/ into separate domain directories: - cuopt-c/continuous/ — LP/QP/SOCP C API, settings, and examples - cuopt-c/mip/ — MIP C API, settings, and examples - cuopt-python/continuous/ — LP/QP/SOCP Python API and examples - cuopt-python/mip/ — MIP Python API and examples Parallel structure with cuopt-python/routing/ for consistency. Update all cross-references in settings, grpc, and parent index files. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
cuOpt reads quadratic constraints in QCQP format and converts to second-order cone form internally. Update the problem formulation, example comments, and C API note to reflect the actual user-facing API. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…neral QCQP cuOpt supports SOCP, not general QCQP. SOC constraints are specified via the quadratic constraint API (||u||_2 <= t written as u^T*u - t^2 <= 0), and cuOpt detects SOC structure internally. Make this distinction explicit and add a note that arbitrary quadratic constraints are not supported. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
||
| .. note:: | ||
| ``cuOptAddQuadraticConstraint`` enables **SOCP (beta)** support. SOC constraints are specified | ||
| as quadratic inequalities (e.g. ``u^T*u - t^2 <= 0`` for ``||u||_2 <= t``); cuOpt detects the |
There was a problem hiding this comment.
Rotated SOC format (u^T*u <= t * y, y >= 0, t >= 0) should be documented if supported.
|
|
||
| .. code-block:: text | ||
|
|
||
| Optimal solution found in 0.00 seconds |
There was a problem hiding this comment.
Do we have a way to test that the script produces exactly this output?
There was a problem hiding this comment.
I think so. @rgsl888prabhu I remember you had a way to test these.
|
|
||
| .. note:: | ||
| The QP solver is not currently supported in third-party modeling languages. | ||
| The QP and SOCP solvers are not currently supported in third-party modeling languages. |
There was a problem hiding this comment.
QP is supported via JuMP, and I think this text may not age well since other interfaces will likely add support for socp quickly.
| ||u_i||_2 <= t_i (second-order cone constraints) | ||
| lb <= x <= ub | ||
|
|
||
| Because cuOpt does not accept cone constraints directly, SOC constraints are specified through the quadratic constraint API. Each SOC constraint ``||u||_2 <= t`` is expressed as the equivalent quadratic inequality ``u^T*u - t^2 <= 0``. cuOpt detects the SOC structure and converts to cone form internally before solving with the barrier method. |
There was a problem hiding this comment.
Mention rotated SOC if supported.
Add CVXPY (LP + QP), update JuMP to include QP support. Clarify AMPL and GAMS are LP-only. Use a table for clarity. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Description
Issue
Checklist